package service.impl;

import java.util.List;

import dao.CustomerDao;
import dao.DaoFactory;
import pojo.Customer;
import service.CustomerManager;

public class CustomerManagerImpl implements CustomerManager {
	CustomerDao customerDao;
	
	
	public CustomerManagerImpl() {
		super();
		customerDao = DaoFactory.getInstance();
	}

	@Override
	public int addCustomer(Customer c) {
		int m = customerDao.addCustomer(c);
		return m;
	}

	@Override
	public List<Customer> loadAllCustomers() {
		List<Customer> customers = customerDao.loadAllCustomers();
		return customers;
	}

	@Override
	public int deleteCustomer(Integer id) {
		int m = customerDao.deleteCustomer(id);
		return m;
	}

	@Override
	public int updateCustomer(Customer c) {
		int m = customerDao.updateCustomer(c);
		return m;
	}

	@Override
	public Customer loadCustomer(Integer id) {
		Customer c = customerDao.loadCustomer(id);
		return c;
	}

}
